package com.carworld.controller;

import com.carworld.config.BaseController;
import com.carworld.config.UserInter;
import com.carworld.model.BimSpares;
import com.jfinal.aop.Before;

public class MenuController extends BaseController {

	/**
	 * 获取菜单,保存客户点单的桌号
	 */
	public void getMealsList() {
		String shopId = this.getCookie("shopId");
		String tableNum = getPara("tableNum");
		this.setCookie("tableNum", tableNum, 1 * 24 * 60 * 60); // 将桌号存入cookie中，有效期24h
		renderPageJson(BimSpares.dao.getBimSparess(shopId));
	}

	@Before(UserInter.class)
	public void index() {
		String shopId = getPara("shopId");
		this.setCookie("shopId", shopId, 1 * 24 * 60 * 60);
		render("index.html");
	}

}
